<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script>
  /*let newVar = prompt("请输入一个数");
  let i = 0;
  let sum = 0;
  /!*let number = 12%12;
  alert(number)*!/
  while(i <= newVar){
      if(i % 2 == 0){
          sum += i;
      }
      i++;

  }
  alert(sum);*/
  function maxarr(arr){
      let test_max = arr[0];
      for (let i = 1; i < arr.length ; i++) {
          if(arr[i] > test_max){
              test_max = arr[i];
          }
      }
      return test_max;
  }

  var arr = [1, 5, 9 , 4];
  var ma = maxarr(arr);
  alert(ma)

</script>
<!--<script src="../js/a.js"></script>-->


</body>
</html>